#include <Core.h>
#include "ScreenshotWidget.h"
#include <Kernel/Screenshot.h>

ScreenshotWidget::ScreenshotWidget(QWidget *parent):
    QGraphicsView(parent),
    graphics_scence(new QGraphicsScene)
{
    this->setScene(graphics_scence);
    this->scale(0.246,0.246);
}

void ScreenshotWidget::cut()
{
    auto frame = Screenshot::cut_frame();
    QImage img(frame.data,frame.width,frame.height,QImage::Format::Format_RGB32);
    graphics_scence->addPixmap(QPixmap::fromImage(img));
}

